#!/usr/bin/env python
#coding=utf-8
# 支持中文  支持python ./
import sys
# 输出方式
print >> sys.stderr, 'Fatal error: invalid input!'
print 'helloWorld'
print '%s say hello ' % ("python")
logfile = open('/tmp/mylog.txt', 'a')
print >> logfile, 'Fatal error:invalid input'
logfile.close()

# 输入方式
'''
user = raw_input('Enter login name:')
print 'Your login is:',user


num = raw_input('Now enter a number: ')
print 'Doubling your number : %d' % (int(num) * 2)
'''


# 获得帮助
# help(raw_input)


def foo():
    "This is a doc string. 注释"
    print "function"
    return True

foo()

# 次方  等于 9
print 3 ** 2

# 比较
'''
True
False
True
True
True
'''
print 2 < 4
print 2 < 4 and 2==4
print 2 > 4 or 2 < 4
print not 6.2 <= 6
# 实际上   3 < 4 and 4 < 5
print 3 < 4 < 5

# 变量和赋值
# 大小写敏感
case = 1
cASE = 2
print '%d %d'%(case, cASE)

# cout 1.1  
print 1.1

# 字符串
pystr = 'Python'
print pystr[0]
print pystr[2:5] # tho [2,5)
print pystr[:2] # Py 
print pystr[-1] # n
print '-' * 20 # --------------------




















